<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <h2>我是根组件</h2>
    <son :age="18" :obj="obj111" :arr="arr" :flag="true" :item="test"></son>
  </div>
  <script src="./vue.js"></script>
  <script>
    // component 组件
    Vue.component('son', {
      props: ['age', 'obj', 'arr', 'flag', 'item'],
      template: `<div>我是子组件son--{{typeof flag}}-{{arr[0]}}--{{typeof age}}--{{obj.uname}}  ---{{1 + age}}</div>`
    })

    new Vue({
      data: {
        obj111: {
          uname: 'zs'
        },
        test: 'qwer',
        arr: ['q', 'w']
      },
      el: '#app'
    })
  </script>
</body>
</html>